package com.yupi.yuoj.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yupi.yuoj.model.dto.question.QuestionQueryRequest;
import com.yupi.yuoj.model.dto.questionsubmit.QuestionSubmitQueryRequest;
import com.yupi.yuoj.model.entity.Question;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yupi.yuoj.model.entity.QuestionSubmit;
import com.yupi.yuoj.model.entity.User;
import com.yupi.yuoj.model.vo.QuestionSubmitVO;
import com.yupi.yuoj.model.vo.QuestionVO;

import jakarta.servlet.http.HttpServletRequest;
/**
* @author 李胜
* @description 针对表【question(题目)】的数据库操作Service
* @createDate 2025-08-27 16:19:26
*/
public interface QuestionService extends IService<Question> {

    org.springframework.data.domain.Page searchFromEs (String keyword, int pageNum, int pageSize);

    void validQuestion(Question question, boolean b);

    QuestionVO getQuestionVO(Question question, HttpServletRequest request);

    Wrapper<Question> getQueryWrapper(QuestionQueryRequest questionQueryRequest);

    Page<QuestionVO> getQuestionVOPage(Page<Question> pages, HttpServletRequest request);

    /**
     * 分页获取提交通过的题目
     * @param questionQueryRequest
     * @param loginUser
     * @return
     */
    Page<Question> listQuestionVOMyAcByPage(Page<Question> page, QuestionQueryRequest questionQueryRequest, User loginUser);

    /**
     * 分页获取历史提交
     * @param questionPage
     * @param questionSubmitQueryRequest
     * @param loginUser
     * @return
     */
    Page<QuestionSubmitVO> listQuestionVOMyHistorySubmitByPage(Page<QuestionSubmit> questionPage, QuestionSubmitQueryRequest questionSubmitQueryRequest, User loginUser);
}
